package Operation;


import book.BookList;

import java.util.Scanner;

public class Return implements IOperation {
    public void work(BookList bookList) {
        System.out.println("返还图书");
        System.out.println("请输入你要归还的书籍");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int index = 0;
        for (int i = 0; i < bookList.getNumberBooksExisted(); i++) {
            if(name.equals(bookList.books[i].getName())) {
                bookList.books[i].setLending_situation(false);
                System.out.println("归还成功");
                return;
            }
        }
        System.out.println("归还失败");
    }
}
